/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.system;

import com.enation.app.javashop.client.system.UploadFactoryClient;
import com.enation.app.javashop.core.client.fallback.system.UploadFactoryClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.base.vo.FileVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @version v7.0
 * @Description: 存储方案Client
 * @Author: zjp
 * @Date: 2018/7/27 16:26
 */
@FeignClient(value = "system-service", fallbackFactory = UploadFactoryClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface UploadFactoryClientFeignImpl extends UploadFactoryClient {
    /**
     * 获取存储方案对象
     *
     * @return 实例化的存储方案对象
     */
    @Override
    @RequestMapping(value = "/client/uploader", method = RequestMethod.GET)
    String getUrl(@RequestParam("url") String url, @RequestParam("width") Integer width, @RequestParam("height") Integer height);

    @Override
    @RequestMapping(value = "/client/uploader", method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FileVO upload(@RequestPart(value = "file") MultipartFile file, @RequestParam("scene")String scene);



}
